package 实践.class_02;

import java.util.Scanner;

public class Demo_02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int tag = sc.nextInt();
        double sum = 0.0;
        for (int i = 1; i < tag+1; i++) {
            if (i%2 != 0) {
                sum+=1.0/(3*i-2);
            }else {
                sum-=1.0/(3*i-2);
            }
        }
        System.out.printf("sum = "+"%.3f%n",sum);
    }
}
